import PropTypes from 'prop-types';
import React from 'react';
import Avatar from './avatar';

/**
 * 用户信息组件
 * @param {*} props 
 * @returns 
 */
function UserInfo(props) {
  return (
    <div className="UserInfo">
        <Avatar user={props.user} />
        <div className="UserInfo-name">
            {props.user.name}
        </div>
    </div>
  )
}

UserInfo.propTypes = {
  user: PropTypes.object.isRequired
}

export default UserInfo
